<?php defined('SYSPATH') OR die('No direct access allowed.'); ?>
<div class="box" style="text-align: left;">
<form action="<?=url::base()?>index.php/find_product/search/0" method="post">
	<table width="100%" >		
		<tr height="30px;" >
			<td width="200px" align="right">ชื่อสินค้า  : </td>
			<td width="250px;" align="left"><input style="width: 100%;" type="text" name="keyword" value="<?=$keyword?>" maxlength="50"></td>
			<td></td>
		</tr>
		<tr height="80px;" valign="middle">
			<td width="200px" align="right"></td>
			<td width="250px;" align="left">
				<input type="submit" style="width: 110px;height: 30px;" name="submit" value="ตกลง">
				<input type="reset" style="width: 110px;height: 30px;" name="reset" value="ยกเลิก">
			</td>
			<td><?=" "?></td>
		</tr>
	</table>
</form>
<div id="gallery">
<table style="width: 99%" align="center" cellspacing="2">
	<tbody style="width: 100%" >
	<?php
	$mc=0;
	foreach ($products as $product) {
		if($mc%2==0){?>
		<tr style="width: 100%">
			<td width="50%" align="center">
				<table style="width: 200px;border: 0px solid rgb(221, 221, 221);" align="center" border="0">
					<tbody>
						<tr >
							<td colspan="2" align="center">
								<a href="<?php echo url::base(FALSE).''.$product->image?>" title="<?="รหัสสินค้า  : ".$product->id."<br/>ชื่อสินค้า  : ".$product->name."<br/>รายละเอียด  : ".$product->description.'<br/>ราคา : '.$product->price?>">
							         <img style="border: 2px solid rgb(221, 221, 221);" src="<?php echo url::base(FALSE).''.$product->thumbnail?>" />
							    </a>	
							</td>
						</tr>
						<tr ><td width="20%" align="right">ชื่อ :</td><td align="left"><?=$product->name?></td></tr>
						<tr><td align="right">ราคา :</td><td align="left"><?=$product->price?></td></tr>
						<tr>
							<td align="left" colspan="2">
								&nbsp;&nbsp;<img style="border: 0px;" src="<?=url::base(FALSE)."/images/icon/card/addtocart.gif"?>" />
							</td>
						</tr>
					</tbody>
				</table><br/>
			</td>
		<?php }else{ ?>
			<td width="50%" align="center">
				<table style="width: 200px;border: 0px solid rgb(221, 221, 221);" align="center" border="0">
					<tbody >
						<tr >
							<td colspan="2" align="center">
								<a href="<?php echo url::base(FALSE).''.$product->image?>" title="<?="รหัสสินค้า  : ".$product->id."<br/>ชื่อสินค้า  : ".$product->name."<br/>รายละเอียด  : ".$product->description.'<br/>ราคา : '.$product->price?>">
							         <img style="border: 2px solid rgb(221, 221, 221);" src="<?php echo url::base(FALSE).''.$product->thumbnail?>" />
							    </a>
							</td>
						</tr>
						<tr ><td width="20%" align="right">ชื่อ :</td><td align="left"><?=$product->name?></td></tr>
						<tr><td align="right">ราคา :</td><td align="left"><?=$product->price?></td></tr>
						<tr>
							<td align="left" colspan="2">
								&nbsp;&nbsp;<img style="border: 0px;" src="<?=url::base(FALSE)."/images/icon/card/addtocart.gif"?>" />
							</td>
						</tr>
						
					</tbody>
				</table><br/>
			</td>
		<tr>
		<?php }
		$mc++;
	}?>
	
	</tbody>
</table>
</div>
<table style="width: 100%">
	<tr style="width: 100%">
		<td style="width: 50px">Page :: &nbsp;</td>
		<td align="left"><?=$pagination->render()?></td>
	</tr>
</table>
<?php echo "count : ".$product_count ?>
</div>
